package org.example.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.order.entity.Good;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface GoodMapper extends BaseMapper<Good> {
    int insertGood(Good good);
    List<Good> selectAll();
    Good selectById(@Param("id") Long id);
    int updateGood(Good good);
    int deleteGood(@Param("id") Long id);

    List<Good> selectByFilter(
            @Param("name_filter") String nameFilter,
            @Param("class_filter") String classFilter,
            @Param("status") String status,
            @Param("price_start") BigDecimal priceStart,
            @Param("price_end") BigDecimal priceEnd
    );
}
